import request from '../utils/request'
import API from './constants'

// 登录
export const login = ({ username, password }) =>
  request({
    url: API.SESSION_API,
    method: 'POST',
    data: {
      username,
      password,
    },
  })

// 退出登录
export const logout = () =>
  request({
    url: API.SESSION_API,
    method: 'DELETE',
  })

// 获取用户菜单
export const getMenus = () =>
  request({
    url: '/api/v1/permissions',
    methos: 'GET',
  })
